#!/bin/bash
# Copyright 2023 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================

echo "===============================================start training==============================================="

task_name=$1
device_target=$2
device_id=$3
teacher_model_dir=$4
student_model_dir=$5
output_dir=$6
data_dir=$7

mkdir -p ms_log
PROJECT_DIR=$(cd "$(dirname "$0")" || exit; pwd)
CUR_DIR=`pwd`
export GLOG_log_dir=${CUR_DIR}/ms_log
export GLOG_logtostderr=0
python ${PROJECT_DIR}/../trainw.py \
    --task_name=$task_name \
    --device_target=$device_target \
    --device_id=$device_id \
    --teacher_model_dir=$teacher_model_dir \
    --student_model_dir=$student_model_dir \
    --output_dir=$output_dir \
    --data_dir=$data_dir> train_log.txt 2>&1 &

